package com.hqd.ch03.v35.web.context.request;

import java.security.Principal;
import java.util.Iterator;
import java.util.Locale;
import java.util.Map;

public interface WebRequest extends RequestAttributes {

    /**
     * 获取请求头
     *
     * @param headerName
     * @return
     */
    String getHeader(String headerName);

    String[] getHeaderValues(String headerName);

    Iterator<String> getHeaderNames();

    String getParameter(String paramName);

    String[] getParameterValues(String paramName);

    Iterator<String> getParameterNames();

    Map<String, String[]> getParameterMap();

    Locale getLocale();

    String getContextPath();

    String getRemoteUser();

    Principal getUserPrincipal();

    boolean isUserInRole(String role);

    boolean isSecure();

    /**
     * 检查资源是否过期
     *
     * @param lastModifiedTimestamp
     * @return
     */
    boolean checkNotModified(long lastModifiedTimestamp);

    boolean checkNotModified(String etag);

    boolean checkNotModified(String etag, long lastModifiedTimestamp);

    String getDescription(boolean includeClientInfo);

}
